package com.yiqi.lottery.feature.football.model;

import com.suozhang.framework.component.http.RxDataProcessFactory;
import com.suozhang.framework.entity.bo.PageData;
import com.yiqi.lottery.entity.bo.BallMatchBo;
import com.yiqi.lottery.entity.bo.BallMatchBo2;
import com.yiqi.lottery.feature.football.contract.FootballContract;
import com.yiqi.lottery.feature.football.dependencies.football.DaggerFootballModelComponent;
import com.yiqi.lottery.framework.api.ApiLib;
import com.yiqi.lottery.framework.api.FootballApi;
import javax.inject.Inject;
import io.reactivex.Observable;

public class FootballModel implements FootballContract.Model {

    @Inject
    FootballApi api;


    @Inject
    public FootballModel() {
        DaggerFootballModelComponent.builder().apiComponent(ApiLib.apiComponent()).build().inject(this);
    }

    @Override
    public Observable<PageData<BallMatchBo>> getFootballMatchList(String label) {
        return api.getFootballMatch(label).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }

    @Override
    public Observable<PageData<BallMatchBo2>> getFootballMatchList2(String label) {
        return api.getFootballMatch2(label).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }

    @Override
    public Observable<BallMatchBo> getFootballSFC() {
        return api.getFootballSFC().compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }
}
